package tp2lab;

import static org.junit.Assert.*;

import org.junit.*;

public class HandTest {
    private Handy hand;
    private Card [] cards;
    
    @Before
    public void setUp(){
        cards = new Card[5];
        for(int i = 0; i < 5; ++i){
            cards[i] = new Card(Integer.toString(i + 2), "pik", i + 2);
        }
        hand = new Handy(cards);
    }
    
    @Test
    public void getCardTest(){
        assertSame("Nie dziala metoda getCard() klasy hand", cards[3], hand.getCard(3));
    }
    
    @Test
    public void exchangeTest(){
        Card podmieniona = new Card("A", "karo", 14);
        hand.exchange(4, podmieniona);
        assertSame("Nie dziala metoda exchange() klasy hand", podmieniona, hand.getCard(4));
    }
    
    @Test
    public void show(){
        assertTrue("Nie dziala metoda show() klasy hand", hand.show());
    }
    
    @After
    public void tearDown(){
        hand = null;
    }
}
